package com.easy.west.westclient.api.vod.api;

import android.content.Context;
import android.support.annotation.NonNull;

import com.easy.west.westclient.api.base.bean.ResultBean;
import com.easy.west.westclient.api.base.callback.BaseCallBack;
import com.easy.west.westclient.api.base.impl.BaseImpl;
import com.easy.west.westclient.api.hotvod.bean.VodList;
import com.easy.west.westclient.api.vod.bean.AlbumBeanList;
import com.easy.west.westclient.api.vod.bean.CollectList;
import com.easy.west.westclient.api.vod.event.CancleCollectVodEvent;
import com.easy.west.westclient.api.vod.event.CollectEvent;
import com.easy.west.westclient.api.vod.event.GetAllAlbumEvent;
import com.easy.west.westclient.api.vod.event.GetAllClassEvent;
import com.easy.west.westclient.api.vod.event.GetColloectListEvent;
import com.easy.west.westclient.api.vod.event.GetHotAlbumEvent;
import com.easy.west.westclient.api.vod.event.GetVodListByCidEvent;
import com.easy.west.westclient.api.vod.event.IsCollectVodEvent;
import com.easy.west.westclient.util.UUIDGenerator;

public class VodImpl extends BaseImpl<VodService> implements VodApi{
    public VodImpl(@NonNull Context context) {
        super(context);
    }

    /**
     * 注释见接口
     * @return
     */
    @Override
    public String getAllClass() {
        String uuid = UUIDGenerator.getUUID();
        service.getClassList().enqueue(new BaseCallBack<>(new GetAllClassEvent(uuid)));
        return uuid;
    }

    @Override
    public String getVodByCid(long cid) {
        String uuid = UUIDGenerator.getUUID();
        service.getVodlistByCid(cid).enqueue(new BaseCallBack<VodList>(new GetVodListByCidEvent(uuid)));
        return uuid;
    }

    @Override
    public String colloctVod(long uid, long vid) {
        String uuid = UUIDGenerator.getUUID();
        service.colloectVod(uid,vid).enqueue(new BaseCallBack<ResultBean>(new CollectEvent(uuid)));
        return uuid;
    }

    @Override
    public String cancelVod(long uid, long vid) {
        String uuid = UUIDGenerator.getUUID();
        service.cancelColloectVod(uid,vid).enqueue(new BaseCallBack<ResultBean>(new CancleCollectVodEvent(uuid)));
        return uuid;
    }

    @Override
    public String getCollectList(long uid) {
        String uuid = UUIDGenerator.getUUID();
        service.getMyCollocetList(uid).enqueue(new BaseCallBack<CollectList>(new GetColloectListEvent(uuid)));
        return uuid;
    }

    @Override
    public String isColloect(long uid, long vid) {
        String uuid = UUIDGenerator.getUUID();
        service.isColloectVod(uid,vid).enqueue(new BaseCallBack<Boolean>(new IsCollectVodEvent(uuid)));
        return uuid;
    }

    @Override
    public String getHotAlbum() {
        String uuid = UUIDGenerator.getUUID();
        service.getHotAlbum().enqueue(new BaseCallBack<AlbumBeanList>(new GetHotAlbumEvent(uuid)));
        return uuid;
    }

    @Override
    public String getAllAlbum() {
        String uuid = UUIDGenerator.getUUID();
        service.getAllAlbum().enqueue(new BaseCallBack<AlbumBeanList>(new GetAllAlbumEvent(uuid)));
        return uuid;
    }
}
